Add ZMQ RPC function 'GetTreePaths' for LWS wallets#278
Add ZMQ RPC function 'GetTreePaths' for LWS wallets#278vtnerd wants to merge 1 commit intoseraphis-migration:fcmp++-stagefrom
Conversation
| RPC_MESSAGE_MEMBER(std::vector<rpc::path_request>, outputs); | ||
| END_RPC_MESSAGE_RESPONSE; | ||
| BEGIN_RPC_MESSAGE_RESPONSE; | ||
| RPC_MESSAGE_MEMBER(std::vector<rpc::path_response>, paths); |
There was a problem hiding this comment.
You might be interested in #89 which allows for a much more compact response when dealing with multiple paths at once.
There was a problem hiding this comment.
I'll wait until that finalizes before incorporating it into this patch. Although its been sitting a while ...
|
@j-berman in #89 showed desired to slowly deprecate |
|
@vtnerd personally I think it would be nice to eventually deprecate the amount-style indexes for FCMP++ / Carrot outputs, since they're definitely no longer relevant at that point and would just be debt. But we will need them into perpetuity for pre-FCMP++/Carrot outputs in order to validate legacy ring signatures. That might lead to a frankenstein impl that supports the amount-style indexes for just legacy outputs over an RPC, and global for future. But we can implement an "optimal" solution from a space-saving perspective where lws still wouldn't need a rescan. I'm open to whatever. |
|
@j-berman my current strategy is to change Then, the Lws servers that don't update for the hardfork will eventually see an empty array for output indexes, and will error out until the user upgrades lws. And they'll probably trigger an unknown output type (is_carrot) before this anyway. The frontend project will have a new boolean sent from server to indicate whether it's using new indexing. If the user doesn't upgrade their wallet they can't send any transactions anyway so this part is easy. |
|
That sounds good to me |
|
Ran into a snag, just need to confirm something. There doesn't appear to be way to directly get "unified" ids from a tx hash, only "legacy" ids. I really don't want to make a DB change just for LWS/ZMQ-RPC, but I think I've found a suitably quick way to get the unified IDs. @j-berman what I need is confirmation that for post-ringct blocks, every unified id will be offset by the same value from legacy id values. In other words, legacy->unified mappings are only complicated for pre-ringct outputs, whereas post-ringct its just a fixed adjustment. |
|
@vtnerd this assumption isn't true at the moment since pre-RingCT txs are still allowed on the chain in rare scenarios (unmixable sweep txs). The FCMP++ v17 fork should disallow them forever, at which point, I think that your assumption will be true. |
|
Good to know. That's all I really needed to make the protocol work, pre fcmp++ blocks must use the legacy IDs anyway. |
|
That's a clever trick, I hadn't thought of that ;) |
193c0a5 to
b0c4fbe
Compare
|
Force pushed a change:
These are somewhat specific for LWS usage, however no DB changes were needed to make it happen. |
This adds (controversially) a ZeroMQ RPC for LWS wallets to build/construct a proper fcmp++ tree proof. The RPC takes a list of
{amount, amount_index}and returns information to init + build a tree cache for those outputs. I have verified locally that the transactions constructed from this RPC are accepted by a daemon.This new RPC leaks outputs from a wallet to the daemon, which is roughly the same privacy of existing LWS wallets. The only difference is that currently the decoy ring outputs are leaked to the daemon, whereas this leaks the spent outputs directly.
@j-berman will the
{amount, amount_index}DB calls be deprecated at some point? I can modify the RPC to accept either the old or "new" style output indexing, using the old style means that LWS databases don't require a re-scan to work.